Tone mapping techniques for increased dynamic range

ABSTRACT

An electronic device may be provided with a display. A content generator such as a camera may capture images in high dynamic range mode or standard dynamic range mode. The images may have associated image metadata such as face detection information, camera settings, color and luminance histograms, and image classification information. Control circuitry in the electronic device may determine tone mapping parameters for the captured images based on the image metadata. The tone mapping parameters for a given image may be stored with the image in the metadata file. When it is desired to display the image, the control circuitry may apply a tone mapping process to the image according to the stored tone mapping parameters. The algorithm that is used to determine tone mapping parameters based on image metadata may be based on user preference data gathered from a population of users.

This application claims the benefit of provisional patent applicationNo. 62/677,569, filed May 29, 2018, which is hereby incorporated byreference herein in its entirety.

BACKGROUND

This relates generally to electronic devices, and, more particularly, toelectronic devices with displays.

Electronic devices often include displays. If care is not taken, displaycontent may not take advantage of the full dynamic range of a display.For example, some electronic devices automatically reduce the dynamicrange of high dynamic range images so that the images can be displayedon a standard dynamic range display. When the image is instead displayedon a high dynamic range display, the image may appear dull or mayotherwise lack bright whites and dark blacks.

SUMMARY

An electronic device may be provided with a display. A content generatorin the electronic device may provide content to be displayed on thedisplay.

A content generator such as a camera may capture images in high dynamicrange mode or standard dynamic range mode. The images may haveassociated image metadata such as face detection information, camerasettings, color and luminance histograms, and image classificationinformation.

Control circuitry in the electronic device may determine tone mappingparameters for the captured images based on the image metadata. The tonemapping parameters for a given image may be stored with the image in themetadata file. When it is desired to display the image, the controlcircuitry may apply a tone mapping process to the image according to thestored tone mapping parameters. The algorithm that is used to determinetone mapping parameters based on image metadata may be based on userpreference data gathered from a population of users.

The tone mapping parameters may be used to increase the dynamic range ofthe image to take advantage of the capabilities of a high dynamic rangedisplay. For example, an image captured in high dynamic range mode mayundergo an initial tone mapping process that reduces the dynamic rangeof the image so that it can be displayed on a standard dynamic rangedisplay. The tone mapping parameters that the control circuitrydetermines based on image metadata may be used to reverse some of theinitial tone mapping process to increase the dynamic range of the imageso that it can be displayed on a high dynamic range display.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a schematic diagram of an illustrative electronic devicehaving a display in accordance with an embodiment.

FIG. 2 is a graph showing how the dynamic range of a captured image maybe reduced using a first tone mapping process and increased using asecond tone mapping process in accordance with an embodiment.

FIG. 3 is a graph showing how the dynamic range of an image may beincreased using a tone mapping process in accordance with an embodiment.

FIG. 4 is a graph showing how content-luminance-to-display-luminancemapping curves may be characterized by tone mapping parameters inaccordance with an embodiment.

FIG. 5 is a flow chart of illustrative steps involved in building amapping algorithm for mapping image metadata to tone mapping parametersin accordance with an embodiment.

FIG. 6 is a flow chart of illustrative steps involved in operating anelectronic device in accordance with an embodiment.

DETAILED DESCRIPTION

An illustrative electronic device of the type that may be provided witha display is shown in FIG. 1. As shown in FIG. 1, electronic device 10may have control circuitry 12. Control circuitry 12 may include storageand processing circuitry for supporting the operation of device 10. Thestorage and processing circuitry may include storage such as hard diskdrive storage, nonvolatile memory (e.g., flash memory or otherelectrically-programmable-read-only memory configured to form a solidstate drive), volatile memory (e.g., static or dynamicrandom-access-memory), etc. Processing circuitry in control circuitry 12may be used to control the operation of device 10. The processingcircuitry may be based on one or more microprocessors, microcontrollers,digital signal processors, baseband processors, power management units,audio chips, application-specific integrated circuits, graphicsprocessing units, display driver circuitry such as timing controllerintegrated circuits and other display driver integrated circuits, andother control circuitry.

Control circuitry 12 is configured to execute instructions forimplementing desired control and communications features in device 10.For example, control circuitry 12 may be used in determining pixelluminance levels that are to be used in displaying content for a user.Pixel luminance levels may be based, for example, on metadata associatedwith the content that is being displayed, ambient light conditions,user-adjusted display brightness settings, statistical informationassociated with content that is being displayed, and displaycharacteristics. Control circuitry 12 may be configured to perform theseoperations using hardware (e.g., dedicated hardware such as integratedcircuits and thin-film circuits) and/or software (e.g., code that runson control circuitry 12). Software code for performing control andcommunications operations for device 10 may be stored on non-transitorycomputer readable storage media (e.g., tangible computer readablestorage media). The software code may sometimes be referred to assoftware, data, program instructions, instructions, or code. Thenon-transitory computer readable storage media may include non-volatilememory such as non-volatile random-access memory (NVRAM), one or morehard drives (e.g., magnetic drives or solid state drives), one or moreremovable flash drives or other removable media, other computer readablemedia, or combinations of these computer readable media or otherstorage. Software stored on the non-transitory computer readable storagemedia may be executed on the processing circuitry of control circuitry12 during operation of device 10.

Input-output circuitry 16 in device 10 may be used to allow data to besupplied to device 10 from a user or external equipment, may be used togather environmental data, and may be used to supply data to externalequipment and output for a user. Input-output circuitry 16 may includeinput-output devices 30 such as buttons, joysticks, scrolling wheels,touch pads, key pads, keyboards, microphones, speakers, tone generators,vibrators, cameras, sensors, light-emitting diodes and other statusindicators, touch sensitive displays (e.g., touch sensors overlappingpixel arrays in displays), data ports, etc. As shown in FIG. 1,input-output circuitry 16 may include a color ambient light sensor orother ambient light sensor 32 for gathering ambient light measurements(e.g., ambient light levels such as ambient light luminance measurementsand/or ambient light color measurements such as color temperaturemeasurements and/or color coordinate measurements).

Input-output circuitry 16 may include one or more image sensors such ascamera 34. Camera 34 may be configured to gather image data. Camera 34may be configured to capture images in standard dynamic range mode andhigh dynamic range mode. In standard dynamic range mode, camera 34captures a scene with one exposure. In high dynamic range mode, camera34 captures a scene with multiple exposures, and the multiple exposuresare combined to form a single image. High dynamic range mode enables alarger portion of the dynamic range of a scene to be captured. Highdynamic range images generally include brighter whites and darker darksthan standard dynamic range images. Capturing high dynamic range imagesby combining multiple exposures is merely illustrative. If desired,camera 34 may capture images in high dynamic range mode using only oneexposure and/or by multiplexing spatial gain.

Device 10 may include one or more internal and/or one or more externaldisplays such as illustrative display 14. Display 14 may be mounted in acommon housing with device 10 (e.g., when device 10 is a mobile devicesuch as a cellular telephone, wristwatch device, tablet computer, orlaptop computer or when device 10 is an all-in-one device such as atelevision or desktop computer). In other configurations, display 14 maybe coupled to device 10 wirelessly or with a cable (e.g., when device 10is a desktop computer or a set-top box).

In general, device 10 may be any suitable type of device. Device 10 may,for example, be a computing device laptop computer, a computer monitorcontaining an embedded computer, a tablet computer, a cellulartelephone, a media player, or other handheld or portable electronicdevice, a smaller device such as a wrist-watch device, a pendant device,a headphone or earpiece device, a device embedded in eyeglasses or otherequipment worn on a user's head, or other wearable or miniature device,a television, a computer display that does not contain an embeddedcomputer, a gaming device, a navigation device, an embedded system suchas a system in which electronic equipment with a display is mounted in akiosk or automobile, equipment that implements the functionality of twoor more of these devices, or other electronic equipment. Device 10(e.g., a portable device) may be exposed to a variety of environmentalconditions. For example, ambient light levels and therefore displayglare may vary as a portable device is moved between indoors andoutdoors environments (as an example).

Electronic device may have a housing. The housing, which may sometimesbe referred to as an enclosure or case, may be formed of plastic, glass,ceramics, fiber composites, metal (e.g., stainless steel, aluminum,etc.), other suitable materials, or a combination of any two or more ofthese materials. The housing may be formed using a unibody configurationin which some or all of the housing is machined or molded as a singlestructure or may be formed using multiple structures (e.g., an internalframe structure, one or more structures that form exterior housingsurfaces, etc.). In laptop computers and other foldable devices, a firstportion of the housing may rotate relative to a second portion of thehousing (e.g., a display housing in a laptop computer may rotated abouta hinge axis relative to a base housing in the laptop computer).

Display 14 may be mounted in the housing. Display 14 may have arectangular outline and be surrounded by four peripheral edges, may havea shape that is circular or oval, or may have other suitable outlines.Display 14 may be a touch screen display that incorporates a layer ofconductive capacitive touch sensor electrodes or other touch sensorcomponents (e.g., resistive touch sensor components, acoustic touchsensor components, force-based touch sensor components, light-basedtouch sensor components, etc.) or may be a display that is nottouch-sensitive. Capacitive touch screen electrodes may be formed froman array of indium tin oxide pads or other transparent conductivestructures.

Display 14 may have an array 28 of pixels 36 for displaying images for auser (e.g., video, graphics, text, etc.). Display driver circuitry 26(e.g., thin-film transistor circuitry on display 14 and/or one or moretiming-controller integrated circuits and/or other display driverintegrated circuits) may be used to display images on pixel array 28.Pixel array 28 may include, for example, hundreds or thousands of rowsand hundreds or thousands of columns of pixels 36. To display colorimages, each pixel 36 may include subpixels of different colors. Forexample, each pixel 36 may include, red, green, and blue subpixels orsubpixels of different colors. By varying the relative intensity oflight emitted by each subpixel in a pixel, pixel output color can beadjusted. The color cast (white point) of each pixel can be adjusted bymodifying the gain associated with each subpixel.

The pixel array of display 14 may be formed from liquid crystal display(LCD) components, an array of electrophoretic display pixels, an arrayof plasma display pixels, an array of organic light-emitting diodepixels or other light-emitting diodes, an array of electrowettingdisplay pixels, or pixels based on other display technologies. Display14 may be backlit with an array of locally dimmable light-emittingdiodes or other suitable backlight structures. Display 14 may displayimages with a standard dynamic range (e.g., images that exhibit acontrast ratio of about 1,000:1 between their brightest and darkestpixel luminance values) and/or may display images with a high dynamicrange (e.g., images that exhibit a contrast ratio of about 10,000:1 ormore between their brightest and darkest luminance values).

During operation, content generators in device 10 (e.g., cameras,operating system functions, and/or applications running on controlcircuitry 12) may generate content for display on the pixel array ofdisplay 14. As an example, electronic device 10 may include one or morestandard dynamic range (SDR) content generators 22 (e.g., games or othercode rendering content, content players, etc.) and/or more high dynamicrange (HDR) content generators 20 (e.g., games or other code renderingcontent, content players, etc.). Standard dynamic range content and highdynamic range content may also be generated by camera 34.

To ensure that content is appropriately displayed on display 14, amapping engine such as tone mapping engine 24 may be used to determinetone mapping parameters (sometimes referred to as luminance valuemapping parameters and/or color value mapping parameters) for thecontent that indicate how to map content luminance values to displayluminance values and/or how to map content color values to display colorvalues. Tone mapping engine 24 may provide the appropriate tone mappingparameters for the content to content generators 20 and 22, may storethe appropriate tone mapping parameters for the content in device 10(e.g., in control circuitry 12 or elsewhere in device 10), and/or maydirectly perform content-luminance-to-display-luminance mappingoperations and/or content-color-to-display-color mapping operations onthe content. Tone mapping parameters may include a black level, areference white level, a specular white level, a highlight boost level,a white point, and/or other parameters that define the tone mappingoperations needed to appropriately display content on display 14.

Tone mapping engine 24 may be implemented using code running on controlcircuitry 12 of FIG. 1, control circuitry for display 14 such as displaydriver circuitry 26, and/or other control circuitry and/or may usehardwired features of the control circuitry in device 10. The tonemapping parameters may be expressed in any suitable format. For example,a black level, a reference white level, a specular white level, and/or ahighlight boost level may respectively be a black level in cd/m², areference white level in cd/m², a specular white level in cd/m² and ahighlight boost level in cd/m².

In some arrangements, in may be desirable to use tone mapping engine 24to increase the dynamic range of content for display 14. FIG. 2 is agraph showing how the dynamic range of an image may be adjusted beforebeing displayed on display 14. As shown in FIG. 2, camera 34 may capturehigh dynamic range images having a dynamic range value L3. However, notall displays have sufficiently high dynamic range to be able to displayhigh dynamic range images. For example, a display may have dynamic rangevalue L1, which is less than L3. Dynamic range values L1 and L3 may, asan example, be equal to 100 cd/m² and 600 cd/m², respectively, or mayhave other suitable values. To ensure that high dynamic range imagescaptured by camera 34 are appropriately displayed, the images mayundergo a first tone mapping process that reduces the dynamic range ofthe image to value L1 while maintaining local details in the image. Thefirst tone mapping process may be performed using tone mapping engine 24or may be performed using separate processing circuitry (e.g., imageprocessing circuitry that forms part of camera 34 or other suitablecircuitry).

Other displays such as display 14 may have sufficiently high dynamicrange to display high dynamic range images. In this type of scenario,tone mapping engine 24 be used to increase the dynamic range of theimages from L1 to L2 to take advantage of the full dynamic range ofdisplay 14. Because the second tone mapping process “reverses” some orall of the first tone mapping process, the second tone mapping processis sometimes referred to as an inverse tone mapping process.

In the example of FIG. 2, L2 is less than L3. This is, however, merelyillustrative. If desired, the second tone mapping process may adjust thedynamic range of the image to a value that is greater than or equal tovalue L3.

FIG. 3 shows another illustrative example of how the dynamic range of animage may be adjusted through tone mapping. In the example of FIG. 3,camera 34 captures a standard dynamic range image having dynamic rangevalue L1. Tone mapping engine 24 may, if desired, be used to apply atone mapping process that increases the dynamic range of the image fromL1 to L2 to take advantage of the high dynamic range capabilities ofdisplay 14.

In scenarios of the type described in connection with FIGS. 2 and 3,care must be taken to ensure that tone mapping engine 24 applies theappropriate tone mapping operation when increasing the dynamic range ofcontent such as image content from camera 34. Tone mapping engine 24may, for example, take into account metadata and/or content statisticsassociated with the content to select or determine a desired tonemapping curve. For example, images captured by camera 34 such as highdynamic range images and/or standard dynamic range images may haveassociated metadata embedded therein. Metadata that may be embedded inimages captured by camera 34 include camera settings (e.g., lensaperture, focal length, shutter speed, ISO sensitivity, whether flashwas used or not), image content information (e.g., color and luminancehistograms, whether a face is detected in the image, etc.), imageclassification information (e.g., snow, concert, landscape, etc.) and/orother metadata. Tone mapping engine 24 may use metadata associated witheach image to determine tone mapping parameters for that image. The tonemapping parameters may be written into the image itself (e.g., stored inthe image's metadata file), may be stored elsewhere in control circuitry12, and/or may be applied directly to the image for displaying on pixels36.

If desired, tone mapping engine 24 may select a desired tone mappingcurve based on other information such as display brightness settings(e.g., user defined brightness settings and brightness levels set bydevice 10 to accommodate a normal power operating mode and a low-poweroperating mode), ambient conditions (ambient light level and ambientlight color), content statistics (e.g., information on average pixelluminance and burn-in risk or other information on operating conditionshaving a potential impact on display lifetime, quality information,dynamic range information etc.), and display characteristics (e.g.,display limitations such as maximum achievable pixel luminance, powerconstraints (e.g., due to thermal limitations and/or otherconsiderations), whether device 10 is operating on DC power (power fromthe battery of device 10) or AC power, etc.

The use of tone mapping parameters to definecontent-luminance-to-display-luminance mapping curves is shown in FIG.4. The content luminance and display luminance axes of the graph of FIG.4 have logarithmic scales. In the example of FIG. 4, there are threeillustrative mapping curves: curve 50, 52, and 54. Each of these curvesmay be identified using a set of tone mapping parameters such as a black(BL), reference white level (RW), and specular white level (SW). Duringoperation, tone mapping engine 24 may determine which tone mappingparameters are appropriate for a given image based on the metadataassociated with that image and the capabilities of display 14. Tonemapping engine 24 may embed the selected tone parameters in the image(e.g., with the image metadata), may store the selected tone parameterselsewhere in control circuitry 12, may provide the tone mappingparameters to display driver circuitry 26, and/or may apply the tonemapping curve associated with the selected tone mapping parametersdirectly to the image so that it can be displayed on display 14.

If, for example, tone mapping engine 24 selects tone mapping parametersBL1, RW1, and SW1, control circuitry 12 may map content luminance valuesto display luminance values following curve 50. If tone mapping engine24 selects tone mapping parameters BL2, RW2, and SW2, control circuitry12 may map content luminance values to display luminance valuesfollowing curve 52. If tone mapping engine 24 selects tone mappingparameters BL3, RW3, and SW3, control circuitry 12 may map contentluminance values to display luminance values following curve 54. In thisway, a set of tone mapping parameters (e.g., three or more tone mappingparameters, three to ten tone mapping parameters, fewer than five tonemapping parameters, etc.) can be used by engine 24 to specify a desiredtone mapping relationship for the content generator to follow dependingon current operating conditions.

The tone mapping curves and tone mapping parameters of FIG. 4 are merelyillustrative, however. There may be greater or fewer than three possibletone mapping curves that may be used to map content luminance values todisplay luminance values, and any suitable parameter may be used todefine such curves. Selecting an appropriate tone mapping curve for animage based on the metadata associated with that image may improve thedynamic range and overall quality of the image when rendered on display14.

In addition to determining tone mapping parameters for mapping contentluminance values to display luminance values, tone mapping engine 24may, if desired, determine tone mapping parameters for mapping contentcolor values to display color values. Similar to the example of FIG. 4,each set of tone mapping parameters may define an associated tonemapping curve that maps content colors to display colors.

FIG. 5 is a flow chart of illustrative steps involved in building amapping algorithm for mapping image metadata to the desired tone mappingparameters. This process may be achieved using calibration computingequipment during manufacturing of device 10.

At step 80, the calibration computing equipment may gather training datafrom a given population of users. This may include, for example,displaying different images (e.g., on a display such as display 14and/or a display similar to display 14) for different users andgathering input from the user to determine the user's preferred image.The images may have different image metadata and different tone mappingparameters. The metadata associated with the user-preferred images andthe tone mapping parameters that were used to tone map theuser-preferred images may be used as training data.

At optional step 82, the calibration computing equipment may weight thetraining data according to a user population tolerance criteria. Thismay include, for example, weighting the training data to favor moreconservative tone mapping parameters or to favor more extreme tonemapping parameters.

At step 84, the calibration computing equipment may build a mappingalgorithm that maps metadata to tone mapping parameters. This mayinclude, for example, applying a linear regression model, a machinelearning model, or any other suitable technique for identifying trendsin the training data so that predictions can be made based on new data.The result of this model may be a mathematical formula, a look-up table,a matrix, a matrix equation, or any other suitable mapping algorithmthat maps image metadata to appropriate tone mapping parameters.

At step 86, the mapping algorithm may be stored in device 10 (e.g., incontrol circuitry 12). During operation of device 10 (e.g., during imagecapture and/or during display operations), control circuitry 12 mayapply the mapping algorithm to determine tone mapping parameters for animage based on that image's metadata.

FIG. 6 is a flow chart of illustrative steps involved in operatingdevice 10.

At step 100, camera 34 may capture an image. The image may be a standarddynamic range image created from one exposure or may be a high dynamicrange image created from multiple exposures. The image may be a stillimage or may be associated with video.

At step 102, control circuitry 12 (e.g., tone mapping engine 24 and/orother code running on device 10) may extract metadata from the imagecaptured in step 100. Metadata that may be extracted in step 102 mayinclude camera settings (e.g., lens aperture, focal length, shutterspeed, ISO sensitivity, whether flash was used or not, etc.), imagecontent information (e.g., color and luminance histograms, whether aface is detected in the image, etc.), image classification information(e.g., snow, concert, landscape, etc.), and/or other metadata.

At step 104, control circuitry 12 (e.g., tone mapping engine 24 and/orother code running on device 10) may determine appropriate tone mappingparameters for the image based on the extracted metadata. This mayinclude, for example, applying the mapping algorithm built in step 84 ofFIG. 5, which maps metadata to tone mapping parameters based on userpreference data. This is, however, merely illustrative. If desired, themapping algorithm that maps metadata to tone mapping parameters may beindependent of user preference data. The tone mapping parameters (e.g.,a specular white level, a reference white level, a black level, and/orother tone mapping parameters) may define an associatedcontent-luminance-to-display-luminance tone mapping curve as describedin connection with FIG. 4 and/or may define an associatedcontent-color-to-display-color tone mapping curve.

At optional step 106, control circuitry 12 (e.g., tone mapping engine 24and/or other code running on device 10) may embed the tone mappingparameters determined in step 104 in the image as metadata. By taggingthe image file with the appropriate tone mapping parameters, the imagemay be displayed on display 14 at any time without needing to calculatetone mapping parameters at the time of display. This is, however, merelyillustrative. If desired, tone mapping parameters may be calculated atthe time of display and step 106 may be omitted.

At step 108, control circuitry 12 (e.g., tone mapping engine 24 and/orother code running on device 10) may apply a tone mapping process to theimage using the tone mapping parameters determined in step 104. The tonemapping process may, for example, map content luminance values todisplay luminance values according to a tone mapping curve defined bythe tone mapping parameters, as described in connection with FIG. 4. Ifdesired, the tone mapping operations of step 108 may also includemapping content color values to display color values according to a tonemapping curve defined by tone mapping parameters determined in step 104.

As described above, one aspect of the present technology is thegathering and use of data available from various sources to improve thedisplaying of content. The present disclosure contemplates that in someinstances, this gathered data may include personal information data thatuniquely identifies or can be used to contact or locate a specificperson. Such personal information data can include demographic data,location-based data, telephone numbers, email addresses, home addresses,or any other identifying information.

The present disclosure recognizes that the use of such personalinformation data, in the present technology, can be used to the benefitof users. For example, the personal information data can be used todisplay high dynamic range images for a user. Accordingly, use of suchpersonal information data enables calculated control of how content datais mapped to display data. Further, other uses for personal informationdata that benefit the user are also contemplated by the presentdisclosure.

The present disclosure further contemplates that the entitiesresponsible for the collection, analysis, disclosure, transfer, storage,or other use of such personal information data will comply withwell-established privacy policies and/or privacy practices. Inparticular, such entities should implement and consistently use privacypolicies and practices that are generally recognized as meeting orexceeding industry or governmental requirements for maintaining personalinformation data private and secure. For example, personal informationfrom users should be collected for legitimate and reasonable uses of theentity and not shared or sold outside of those legitimate uses. Further,such collection should occur only after receiving the informed consentof the users. Additionally, such entities would take any needed stepsfor safeguarding and securing access to such personal information dataand ensuring that others with access to the personal information dataadhere to their privacy policies and procedures. Further, such entitiescan subject themselves to evaluation by third parties to certify theiradherence to widely accepted privacy policies and practices.

Despite the foregoing, the present disclosure also contemplatesembodiments in which users selectively block the use of, or access to,personal information data. That is, the present disclosure contemplatesthat hardware and/or software elements can be provided to prevent orblock access to such personal information data. For example, in the caseof gathering image metadata, the present technology can be configured toallow users to select to “opt in” or “opt out” of participation in thecollection of personal information data during registration forservices. In another example, users can select not to provide locationinformation for image capture operations. In yet another example, userscan select to not provide precise location information, but permit thetransfer of location zone information.

Therefore, although the present disclosure broadly covers use ofpersonal information data to implement one or more various disclosedembodiments, the present disclosure also contemplates that the variousembodiments can also be implemented without the need for accessing suchpersonal information data. That is, the various embodiments of thepresent technology are not rendered inoperable due to the lack of all ora portion of such personal information data. For example, image metadatacan be gathered by inferring preferences based on non-personalinformation data or a bare minimum amount of personal information, suchas the content being requested by the device associated with a user,other non-personal information available, or publically availableinformation.

The foregoing is merely illustrative and various modifications can bemade by those skilled in the art without departing from the scope andspirit of the described embodiments. The foregoing embodiments may beimplemented individually or in any combination.

What is claimed is:
 1. An electronic device, comprising: a camera thatcaptures an image having associated image metadata; a display; andcontrol circuitry configured to: apply a first tone mapping to theimage; generate tone mapping parameters for the image using the imagemetadata, wherein the tone mapping parameters are based on at least oneof: whether a face is present in the image and camera settings in theimage metadata file; apply a second tone mapping to the image using thetone mapping parameters; display the image on the display after applyingthe second tone mapping.
 2. The electronic device defined in claim 1wherein the camera captures the image in high dynamic range mode.
 3. Theelectronic device defined in claim 1 wherein the first tone mappingreduces a dynamic range of the image before the control circuitrygenerates the tone mapping parameters.
 4. The electronic device definedin claim 3 wherein the second tone mapping increases the dynamic rangeof the image using the tone mapping parameters.
 5. The electronic devicedefined in claim 1 wherein the control circuitry stores the tone mappingparameters with the image metadata.
 6. The electronic device defined inclaim 1 wherein the control circuitry uses a mapping algorithm todetermine the tone mapping parameters using the image metadata.
 7. Theelectronic device defined in claim 6 wherein the mapping algorithm isbased on training data collected from a population of users.
 8. Theelectronic device defined in claim 1 wherein the tone mapping parametersdefine a tone mapping curve that maps content luminance valuesassociated with the image to display luminance values.
 9. An electronicdevice, comprising: a camera that captures an image in high dynamicrange mode, wherein the image has an associated metadata file; andcontrol circuitry that: applies a first tone mapping to the image;determines tone mapping parameters for the image using the metadatafile, wherein the tone mapping parameters are based on at least one of:face detection information and camera settings in the metadata file, andwherein the tone mapping parameters define a tone mapping curve thatmaps content luminance values to display luminance values; and applies asecond tone mapping to the image using the tone mapping parameters. 10.The electronic device defined in claim 9 wherein the first tone mappingreduces a dynamic range of the image and the second tone mappingincreases the dynamic range of the image.
 11. The electronic devicedefined in claim 10 further comprising a display that displays the imageafter the control circuitry applies the second tone mapping to theimage.
 12. The electronic device defined in claim 9 wherein the controlcircuitry determines the tone mapping parameters using a mappingalgorithm, wherein the mapping algorithm is based on user preferencedata gathered from a population of users.
 13. A method for operating anelectronic device having a camera and control circuitry, comprising:with the camera, capturing an image in high dynamic range mode, whereinthe image has an associated data file with image metadata; and with thecontrol circuitry: applying a first tone mapping to the image;determining tone mapping parameters based on the image metadata, whereindetermining the tone mapping parameters based on the image metadatacomprises determining the tone mapping parameters based on at least oneof: face detection information and camera settings in the imagemetadata; storing the tone mapping parameters in the data file; andapplying a second tone mapping to the image using the tone mappingparameters.
 14. The method defined in claim 13 wherein the tone mappingparameters define a tone mapping curve and wherein applying the secondtone mapping to the image comprises applying the tone mapping curve tothe image to increase a dynamic range of the image.
 15. The methoddefined in claim 14 wherein the electronic device comprises a display,the method further comprising: after applying the tone mapping curve tothe image, displaying the image on the display.
 16. The method definedin claim 14 wherein the first tone mapping reduces the dynamic range ofthe image.
 17. The method defined in claim 13 wherein determining thetone mapping parameters based on the image metadata comprises applying amapping algorithm that is based on user preference data gathered from apopulation of users.